package main

import (
	"fmt"
	"go-guide/crontab/prepare/demo2"
	"os/exec"
	"time"

	"go-guide/crontab/prepare/demo3"
)

var (
	ipAddr string
)

func init() {
	fmt.Println(time.Now())
	fmt.Println("init method")
	ipAddr = ":1234"
}

func main() {

	fmt.Println(ipAddr)

	result := demo2.Add(1, 2)
	fmt.Println(result)

	result2 := demo3.Sub(12, 21)
	fmt.Println(result2)
	var (
		output []byte
		err    error
		cmd    *exec.Cmd
	)

	cmd = exec.Command("D:\\Apps\\Git\\bin\\bash.exe", "-c", "sleep 5; ls -l")

	if output, err = cmd.CombinedOutput(); err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(output))

}
